package com.itmg.tools.timer;

import java.util.List;
import java.util.TimerTask;
import com.itmg.dao.KeywordsDAO;
import com.itmg.dao.model.KeywordsModel;
import com.itmg.factory.DAOFactory;
import com.itmg.util.KeywordsContainer;

/**
 * 同步数据库中和内存中的关键字
 * @author Jason
 *
 */
public class KeywordsTimerTask extends TimerTask {
	
	KeywordsDAO keywordsDAO = null;
	
	public void run() {
		keywordsDAO = DAOFactory.getKeywordsDAO();
		
		List<KeywordsModel> listAll = null;
		try {
			listAll = keywordsDAO.getTopKeywords();
		} catch (Exception e) {
			e.printStackTrace();
		}
	
		KeywordsContainer.clearKeywordsList();
		KeywordsContainer.setKeywordsList(listAll);
		
	}

}
